const common = require('./common');

const url = {
  getComplaintType: "/zgb/v1/complaint/getComplaintType", //获取投诉类型
  listPage: "/zgb/v1/complaint/listPage", //分页获取投诉列表
  getDetail: "/zgb/v1/complaint/getDetail", //获取投诉详情
  getRosterInfo: "/zgb/v1/complaint/getRosterInfo", //获取人员信息
  checkAttendanceRecord: "/zgb/v1/complaint/checkAttendanceRecord", //验证是否有出勤记录
  submit: "/zgb/v1/complaint/submit", //提交投诉
  getMiniUserInfo: "/zgb/v1/complaint/getMiniUserInfo", //获取小程序用户信息
  getProjectList: "/zgb/v1/complaint/getProjectList", //获取项目列表
  cancel: "/zgb/v1/complaint/cancel", //撤销投诉
}


const getComplaintType = (data) => {
  return common.req(url.getComplaintType, data, 'get');
}
const listPage = (data) => {
  return common.req(url.listPage, data, 'post', true);
}
const getDetail = (data) => {
  return common.req(url.getDetail, data, 'get');
}
const getRosterInfo = (data) => {
  return common.req(url.getRosterInfo, data, 'get');
}
const checkAttendanceRecord = (data) => {
  return common.req(url.checkAttendanceRecord, data, 'post', false, false);
}
const submit = (data) => {
  return common.req(url.submit, data);
}
const getMiniUserInfo = (data) => {
  return common.req(url.getMiniUserInfo, data, 'get');
}
const getProjectList = (data) => {
  return common.req(url.getProjectList, data);
}
const cancel = (data) => {
  return common.req(url.cancel, data);
}



export default {
  getComplaintType,
  listPage,
  getDetail,
  getRosterInfo,
  checkAttendanceRecord,
  submit,
  getMiniUserInfo,
  getProjectList,
  cancel
}